<%@page import="bean.B01boardDTO"%>
<%@page import="bean.B01boardVO" %>
<%@page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>List</title>
<link rel="stylesheet" href="./css/B01board.css">

<script src = './js/B01board.js'></script>
</head>
<body>
<jsp:useBean id="vo" class="bean.B01boardVO" scope="page"/>
<jsp:setProperty property="*" name="vo"/>
<%
B01boardDTO dto = new B01boardDTO();
dto.setVo(vo);
ArrayList<B01boardVO> al = dto.select();
%>

<h3>자유게시판<a href ="index1.jsp?inc=./Community/list.jsp"><input type='button' value='더보기' style="margin-left: 870px;"/></a></h3>
	
	<form name = 'hiddenFrm' method='post'>
		 	<input type='hidden' name="nowPage">
		 	<input type='hidden' name='find'>
		 	<input type='hidden' name='b_number'>
	</form>

 	<div class = 'list_title' align="center" style="font-size: small;">
		<div id='list_b_number'>글번호</div>
		<div id='list_b_title'>제목</div>
		<div id='list_m_id'>글쓴이</div>
		<div id='list_b_date'>작성일</div>
		<div id='list_b_image'>파일</div>
	</div>
	
<%
	if(al.size()>0)
	{
	for(int a=0; a<3; a++){ 
		B01boardVO v = al.get(a);
%>
 <div class="list_items" align="center" style="font-size: small;">
		<div id='list_b_number'><%=v.getB_number()%></div>
		<div id='list_b_title'> <!-- 실제 클릭되는 값   -->
			
			<a href = '#' onclick="<%if(session.getAttribute("sessionMid") == null || session.getAttribute("sessionMid").equals(""))
									{%>
										gologin(<%=dto.getNowPage()%>,<%=v.getB_number()%>)"><%=v.getB_title()%>
								   <%}else{%>
								   		goView(<%=dto.getNowPage()%>,<%=v.getB_number()%>)"><%=v.getB_title()%>
								   <%}%>	
<%-- 			<% 	if(v.getB_title().length()>20){
				String title = v.getB_title().substring(0, 20); %>
		    	<%=title%>...
			<%} else {%>
				<%=v.getB_title()%>
			<%}%> --%>
			</a>
		</div>
		<div id='list_m_id'><%=v.getM_id()%></div>
		<div id='list_b_date'><%=v.getB_date()%>

		</div>
		<div id='list_b_modifyDate'><%=v.getB_modifyDate()%></div>
		<div id='list_b_image'>		
		<% if(v.getB_image()!= null){%>	
			 <% if(v.getB_image().length()>15){
				String image = v.getB_image().substring(0, 15); %>
		    	<%=image%>..
			<%}else{%>
				<%=v.getB_image()%> 
			<%}%>	
		<%}else{%>
			파일없음
		<%}%>
		</div>
	</div>	
<%}}%>

</body>
</html>